package org.vaadin.nf4v.core.navigation;

/**
 * Indicates incorrect URI (typed in browser address bar) or parameters string
 * Catched internally to execute InvalidUriHandler.
 * <p/>
 * Thrown by UriHandler or ParamResolver.
 */
public class InvalidUriException extends RuntimeException {
    private boolean invalidPage;
    private boolean invalidParams;

    public InvalidUriException(String message, boolean invalidPage, boolean invalidParams) {
        super(message);
        this.invalidPage = invalidPage;
        this.invalidParams = invalidParams;
    }

    /**
     * @return true if thrown because of invalid uri (no page with this uri could be found)
     */
    public boolean isInvalidPage() {
        return invalidPage;
    }

    /**
     * @return true if thrown because of invalid parameters string
     */
    public boolean isInvalidParams() {
        return invalidParams;
    }
}
